package br.com.felix.bmt.web.components;

import br.com.felix.bmt.model.Post;
import br.com.felix.fwt.ui.Html;
import br.com.felix.fwt.ui.Panel;
import br.com.felix.fwt.ui.css.Border;
import br.com.felix.fwt.ui.css.BorderStyle;
import br.com.felix.fwt.ui.css.BorderWidth;
import br.com.felix.fwt.ui.css.Color;
import br.com.felix.fwt.ui.css.Style;

/**
 * Component that renders a Post.
 * @see Post
 * */
public class PostUi extends Panel{

	private static final long serialVersionUID = 1L;

	private static Style style = new Style().width(640).border(new Border().borderStyle(BorderStyle.SOLID).borderColors(new Color(220,220,220)).borderWidth(BorderWidth.THIN)).margin(10,0,0,0).padding(5);
	
	public PostUi(Post p){
		Panel panel = new Panel();
		panel.add(new Html(p.getContent()));
		panel.setStyle(style);
		add(panel);
	}

}
